#!/run/current-system/sw/bin/bash

#this is what you need to run to prep the files before using configuration.nix

set -e -x

time nix-env -i wget git

test "`id -u`" -eq "0"

mkdir -p -- files/
pushd files
wget -N -- http://winhelp2002.mvps.org/hosts.txt
sha256sum -- hosts.txt
popd

git clone https://github.com/NixOS/nixpkgs.git
pushd nixpkgs
git remote add channels https://github.com/nixos/nixpkgs-channels

#these two must be run every time you want to update(refs too):
git fetch --all
git reset --hard channels/nixos-unstable

#now manually do: time sudo nixos-rebuild switch
#add: --fallback if using the git master branch instead of a channel! to build from sources!

popd



